<?php
defined('IN_PHPCMS') or exit('No permission resources.');
pc_base::load_sys_class('model', '', 0);


class contest_award_model extends model
{

    public function __construct()
    {
        $this->db_config = pc_base::load_config('database');
        $this->db_setting = 'default';
        $this->table_name = 'contest_award';
        parent::__construct();
    }

    public function getList($contest_id,$site=""){
        if(empty($site)){
            $site=get_siteid();
        }
        $where = "";
        $where .= "status = 1 and contest_id=".$contest_id." and siteid =" .$site;
        $award = $this->select($where,'*','', 'id DESC');
        $rtn=array();
        foreach($award as $k=>$v){
            $rtn[$v['id']]=$v['name'];
        }
        return $rtn;


    }
}